﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProgrammerToolsKits.Comic.Modal
{
    public class ComicVolume : Interface.IComicVolume
    {
        static System.Security.Cryptography.HMACMD5 md5 = new System.Security.Cryptography.HMACMD5();
        /// <summary>
        /// 获取该卷的索引
        /// </summary>
        public int Index { get; internal set; }

        /// <summary>
        /// 获取该卷的标题
        /// </summary>
        public string Title { get; internal set; }

        /// <summary>
        /// 获取该卷的源地址
        /// </summary>
        public string Source { get; internal set; }

        /// <summary>
        /// 获取该卷的长度
        /// </summary>
        public int? PageCount { get; internal set; }

        public string Hash {
            get => Convert.ToBase64String( md5.ComputeHash( Encoding.UTF8.GetBytes( Source ) ) );
        }
    }
}
